package com.juntu.loginlib;

import android.content.Context;

import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.juntu.loginlib.util.LoginUtil;

import org.junit.Test;
import org.junit.runner.RunWith;

import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;

/**
 * Instrumented test, which will execute on an Android device.
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
    @Test
    public void useAppContext() {
        // Context of the app under test.
        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();

//        LoginCenter.getInstance().getAppConfig("appServerUrl,pmqInfo,pmqMsgGroupType,loginPlace,jcj_pmqEnum,znzh_qmpEnum,znzh_voiceCmd", new AppConfigContact() {
//            @Override
//            public void getConfigSuccess(AppConfig config) {
//                System.out.println(config.getJcj_pmqEnum());
//            }
//
//            @Override
//            public void getConfigError(LoginException exception) {
//                System.out.println(exception.getMessage());
//            }
//        });

        JsonObject json = new JsonObject();
        json.addProperty("sbbh", LoginUtil.getDeviceId());
        json.addProperty("pp", LoginUtil.getDeviceManufacturer());
        json.addProperty("xh", LoginUtil.getSystemDevice());
        String toJson = new Gson().toJson(json);
        System.out.println(toJson);

    }
}